import axios from "axios";

// axios.defaults.baseURL = "http://106.12.79.128:1901";
export const login = data =>
    axios({
        url: "/api/users/login",
        method: "post",
        data,
        timeout: 5000
    });
export const search = (params = {}) =>
    axios({
        url: `/api/book/fuzzy-search?query=${params}`,
        method: "get",
        timeout: 5000
    });
// 如果是query传参，query=1,params:{query:1}



export const getRankId = () =>
    axios({
        url: "/api/ranking/gender",
        method: "get"
    });
export const getBook = data =>
    axios({
        url: `/api/ranking/${data}`,
        method: "get"
    });

export const getWomanBook = data =>
    axios({
        url: `/api/ranking/${data}`,
        method: "get"
    });
